﻿#ifndef FORWARD_SYSTEM_H
#define FORWARD_SYSTEM_H

#include <QObject>
#include <QMap>
#include <QTcpServer>

class Forward_System : public QObject
{
    Q_OBJECT
public:
    explicit Forward_System(QObject *parent = nullptr);
    
    
    //校验这个端口是否被占用
    static bool portIsOccupy(const int& port);
    
    //使用这个端口
    static bool userPort(const int& port,QTcpServer*server);
    
    //释放这个端口
    static void freedPort(const int& port);
    
    
private:
    static QMap<int,QTcpServer*> global_mapPort;
};

#endif // FORWARD_SYSTEM_H
